<template>
  <div class="detail-base-info">

    <div class="goods-title">
      {{baseInfo.title}}
    </div>

    <div class="goods-price">
      <span class="new-price">
        {{baseInfo.newPrice}}
      </span>
      <span class="old-price">
        {{baseInfo.oldPrice}}
      </span>
      <span class="discount">
        {{baseInfo.discount}}
      </span>
    </div>

    <div class="other-info">
      <span 
        class="other-info-item"
        v-for="(item, index) in baseInfo.columns"
        :key="index">
        {{item}}
      </span>
      <span class="other-info-item">
        {{baseInfo.services[baseInfo.services.length - 1].name}}
      </span>
    </div>

    <div class="goods-services">
      <div 
        class="goods-services-item"
        v-for="(item, index) in baseInfo.services.length - 1"
        :key="index">
        <img :src="baseInfo.services[item - 1].icon" alt="">
        <span>
          {{baseInfo.services[item - 1].name}}
        </span>
      </div>
    </div>

  </div>
</template>

<script>
  export default {
    props: {
      baseInfo: {
        type: Object,
        default: {},
      }
    },
    mounted() {
      // console.log(this.baseInfo);
    }
  }
</script>

<style scoped>

  .detail-base-info {
    width: 100%;
    margin-top: 15px;
    padding: 0 10px;
    color: #999999;
    /* border-bottom: 5px solid #f2f5f8; */
  }

  .goods-title {
    font-size: 18px;
    text-align: justify;  /*两端对齐*/
    color: #222222;
  }

  .goods-price {
    margin-top: 10px;
  }

  .goods-price .new-price {
    font-size: 24px;
    color: #ff5777;
  }
  
  .goods-price .old-price {
    font-size: 13px;
    margin-left: 5px;
    text-decoration: line-through;
  }

  .goods-price .discount {
    font-size: 12px;
    background-color: #ff5777;
    color: #ffffff;
    border-radius: 8px;
    padding: 3px 6px;
    margin-left: 5px;
    position: relative;
    top: -9px;
  }

  .other-info {
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    line-height: 30px;
    border-bottom: 1px solid rgba(100, 100, 100, 0.1);
  }

  .goods-services {
    padding: 30px 0;
    display: flex;
    justify-content: space-between;
  }

  .goods-services-item img {
    width: 14px;
    height: 14px;
    position: relative;
    top: 2px;
    /* vertical-align: middle; */
  }

  .goods-services-item span {
    font-size: 13px;
    margin-left: 3px;
    color: #333333;
  }

</style>